<template>
    <div id="app">
      <el-form :model="order" label-width="100px">
        <el-form-item label="编号" prop="id">
          <el-input v-model="order.id"></el-input>
        </el-form-item>id
        <el-form-item label="用户" prop="uid">
          <el-input v-model="order.uid"></el-input>
        </el-form-item>

        <el-form-item label="订单总价" prop="goodsprice">
          <el-input v-model="order.goodsprice"></el-input>
        </el-form-item>

        <el-form-item label="生成时间" prop="ordertime">
        <el-input v-model="order.ordertime"></el-input>
      </el-form-item>

        <el-form-item label="订单状态" prop="orderstate">
          <el-input v-model="order.orderstate"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click.prevent="test">保存</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          order:{}
        }
      },
      methods:{
        test(){

            this.$confirm("是否确认提交","保存提示").then(()=>{
              this.axios.post("/order/add",this.order).then((resp)=>{
                  this.$message.success("保存成功！");
                  this.$router.push("/order/OrderList")
                });
            });

        }
      }
    }
</script>


<style scoped>

</style>
